<template>
  <div>
    <div class="header">
      <div class="img-box" @click.stop="$router.go(-1)">
        <img src="@/../public/images/1671779704879.png" alt="" />
      </div>
      <div class="text">个人在线简历</div>
    </div>
    <div class="content">
      <div class="first">
        <div class="left">
          <div class="title">
            <div>熊猫女士</div>
            <div class="img-box">
              <img src="@/../public/images/1671953578183.png" alt="" />
            </div>
          </div>
          <div>3年工作经验·25岁·本科</div>
        </div>
        <div class="right">
          <img src="@/../public/images/1668587314171.png" alt="" />
        </div>
      </div>
      <div class="line"></div>
      <div class="item">
        <div class="title">
          <div>个人优势</div>
          <div class="img-box" @click.stop="changeEdithHandler($refs.first)">
            <img src="@/../public/images/1671953578183.png" alt="" />
          </div>
        </div>
        <div class="text" ref="first" contentEditable="false">
          {{ advantage }}
        </div>
      </div>
      <div class="item">
        <div class="title">
          <div>求职期望</div>
          <div class="img-box" @click.stop="changeEdithHandler($refs.sec)">
            <img src="@/../public/images/1671953578183.png" alt="" />
          </div>
        </div>
        <div class="text" ref="sec" contentEditable="false">
          {{ expectation }}
        </div>
      </div>
      <div class="item">
        <div class="title">
          <div>工作经历</div>
          <div class="img-box" @click.stop="changeEdithHandler($refs.three)">
            <img src="@/../public/images/1671953578183.png" alt="" />
          </div>
        </div>
        <pre class="text" ref="three" contentEditable="false">
          {{ experience }}
        </pre>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "ResumeView",
  data: () => {
    return {
      advantage: "有什么个人优势呢？用一两句话表述吧~",
      expectation: "***职业    15~20k",
      experience: `
1、就职日期与离任日期，包括年份和月份。如果工作经历有间断，只列出年份亦可。
2、就职公司的公司全称，如可能，还应提供所在部门名称及母公司名称。
3、工作地点，就职公司所在的城市或区域，以及应聘者工作所在的城市或区域。
4、职务或职位，对于不同的企业，相同的职务可能会有不同的工作内容。
5、具体的工作内容和职责。`,
    };
  },
  methods: {
    changeEdithHandler(item) {
      item.contentEditable = item.contentEditable == "false" ? "true" : "false";
      item.focus();
    },
  },
};
</script>

<style lang="scss" scoped>
.text {
  outline: none;
}
.header {
  width: 100%;
  height: 1rem;
  background-color: #64af57;
  display: flex;
  align-items: center;
  font-size: 0.36rem;
  font-weight: bold;
  color: #ffffff;
  box-sizing: border-box;
  padding: 0 0.3rem;
  .img-box {
    width: 0.15rem;
    min-width: 0.15rem;
    height: 0.28rem;
  }
  .text {
    flex-grow: 1;
  }
}
.content {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.3rem;
  .line {
    width: 100%;
    height: 0.01rem;
    background: #eeeeee;
    margin: 0.4rem 0;
  }
  .first {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .left {
      font-size: 0.24rem;
      color: #333333;
      .title {
        font-size: 0.4rem;
        font-weight: bold;
        color: #333333;
        display: flex;
        align-items: center;
        margin-bottom: 0.3rem;
        .img-box {
          width: 0.28rem;
          height: 0.28rem;
          margin-left: 0.2rem;
        }
      }
    }
    .right {
      width: 1.4rem;
      height: 1.4rem;
      background: #17a1ff;
      box-shadow: 0px 0.06rem 0.21rem 0px rgba(1, 64, 153, 0.22);
      border-radius: 0.7rem;
    }
  }
  .item {
    text-align: start;
    width: 100%;
    .title {
      font-size: 0.3rem;
      font-weight: bold;
      color: #333333;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .img-box {
        width: 0.28rem;
        height: 0.28rem;
      }
    }
    .text {
      margin: 0.4rem 0;
      opacity: 0.7;
      font-size: 0.24rem;
      line-height: 0.4rem;
      color: #333333;
      white-space: pre-wrap;
      word-wrap: break-word;
    }
  }
}
</style>